3.2.98 \(\int \frac {(e+f x)^2 \csc (c+d x)}{a+a \sin (c+d x)} \, dx\) [198]

Optimal. Leaf size=249 \[ \frac {i (e+f x)^2}{a d}-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d}+\frac {(e+f x)^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {4 f (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d^2}+\frac {2 i f (e+f x) \text {Li}_2\left (-e^{i (c+d x)}\right )}{a d^2}+\frac {4 i f^2 \text {Li}_2\left (i e^{i (c+d x)}\right )}{a d^3}-\frac {2 i f (e+f x) \text {Li}_2\left (e^{i (c+d x)}\right )}{a d^2}-\frac {2 f^2 \text {Li}_3\left (-e^{i (c+d x)}\right )}{a d^3}+\frac {2 f^2 \text {Li}_3\left (e^{i (c+d x)}\right )}{a d^3} \]

[Out]

I*(f*x+e)^2/a/d-2*(f*x+e)^2*arctanh(exp(I*(d*x+c)))/a/d+(f*x+e)^2*cot(1/2*c+1/4*Pi+1/2*d*x)/a/d-4*f*(f*x+e)*ln
(1-I*exp(I*(d*x+c)))/a/d^2+2*I*f*(f*x+e)*polylog(2,-exp(I*(d*x+c)))/a/d^2+4*I*f^2*polylog(2,I*exp(I*(d*x+c)))/
a/d^3-2*I*f*(f*x+e)*polylog(2,exp(I*(d*x+c)))/a/d^2-2*f^2*polylog(3,-exp(I*(d*x+c)))/a/d^3+2*f^2*polylog(3,exp
(I*(d*x+c)))/a/d^3

________________________________________________________________________________________

Rubi [A]
time = 0.23, antiderivative size = 249, normalized size of antiderivative = 1.00, number of steps used = 14, number of rules used = 11, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.423, Rules used = {4631, 4268, 2611, 2320, 6724, 3399, 4269, 3798, 2221, 2317, 2438} \begin {gather*} \frac {4 i f^2 \text {PolyLog}\left (2,i e^{i (c+d x)}\right )}{a d^3}-\frac {2 f^2 \text {PolyLog}\left (3,-e^{i (c+d x)}\right )}{a d^3}+\frac {2 f^2 \text {PolyLog}\left (3,e^{i (c+d x)}\right )}{a d^3}+\frac {2 i f (e+f x) \text {PolyLog}\left (2,-e^{i (c+d x)}\right )}{a d^2}-\frac {2 i f (e+f x) \text {PolyLog}\left (2,e^{i (c+d x)}\right )}{a d^2}-\frac {4 f (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d^2}+\frac {(e+f x)^2 \cot \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right )}{a d}-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d}+\frac {i (e+f x)^2}{a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((e + f*x)^2*Csc[c + d*x])/(a + a*Sin[c + d*x]),x]

[Out]

(I*(e + f*x)^2)/(a*d) - (2*(e + f*x)^2*ArcTanh[E^(I*(c + d*x))])/(a*d) + ((e + f*x)^2*Cot[c/2 + Pi/4 + (d*x)/2
])/(a*d) - (4*f*(e + f*x)*Log[1 - I*E^(I*(c + d*x))])/(a*d^2) + ((2*I)*f*(e + f*x)*PolyLog[2, -E^(I*(c + d*x))
])/(a*d^2) + ((4*I)*f^2*PolyLog[2, I*E^(I*(c + d*x))])/(a*d^3) - ((2*I)*f*(e + f*x)*PolyLog[2, E^(I*(c + d*x))
])/(a*d^2) - (2*f^2*PolyLog[3, -E^(I*(c + d*x))])/(a*d^3) + (2*f^2*PolyLog[3, E^(I*(c + d*x))])/(a*d^3)

Rule 2221

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
 - Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 2611

Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(
f + g*x)^m)*(PolyLog[2, (-e)*(F^(c*(a + b*x)))^n]/(b*c*n*Log[F])), x] + Dist[g*(m/(b*c*n*Log[F])), Int[(f + g*
x)^(m - 1)*PolyLog[2, (-e)*(F^(c*(a + b*x)))^n], x], x] /; FreeQ[{F, a, b, c, e, f, g, n}, x] && GtQ[m, 0]

Rule 3399

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(2*a)^n, Int[(c
 + d*x)^m*Sin[(1/2)*(e + Pi*(a/(2*b))) + f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2
- b^2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])

Rule 3798

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + Pi*(k_.) + (f_.)*(x_)], x_Symbol] :> Simp[I*((c + d*x)^(m + 1)/(d*(
m + 1))), x] - Dist[2*I, Int[(c + d*x)^m*E^(2*I*k*Pi)*(E^(2*I*(e + f*x))/(1 + E^(2*I*k*Pi)*E^(2*I*(e + f*x))))
, x], x] /; FreeQ[{c, d, e, f}, x] && IntegerQ[4*k] && IGtQ[m, 0]

Rule 4268

Int[csc[(e_.) + (f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[-2*(c + d*x)^m*(ArcTanh[E^(I*(e + f*
x))]/f), x] + (-Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Log[1 - E^(I*(e + f*x))], x], x] + Dist[d*(m/f), Int[(c +
d*x)^(m - 1)*Log[1 + E^(I*(e + f*x))], x], x]) /; FreeQ[{c, d, e, f}, x] && IGtQ[m, 0]

Rule 4269

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Cot[e + f*x]/f), x
] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 4631

Int[(Csc[(c_.) + (d_.)*(x_)]^(n_.)*((e_.) + (f_.)*(x_))^(m_.))/((a_) + (b_.)*Sin[(c_.) + (d_.)*(x_)]), x_Symbo
l] :> Dist[1/a, Int[(e + f*x)^m*Csc[c + d*x]^n, x], x] - Dist[b/a, Int[(e + f*x)^m*(Csc[c + d*x]^(n - 1)/(a +
b*Sin[c + d*x])), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[m, 0] && IGtQ[n, 0]

Rule 6724

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps

\begin {align*} \int \frac {(e+f x)^2 \csc (c+d x)}{a+a \sin (c+d x)} \, dx &=\frac {\int (e+f x)^2 \csc (c+d x) \, dx}{a}-\int \frac {(e+f x)^2}{a+a \sin (c+d x)} \, dx\\ &=-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d}-\frac {\int (e+f x)^2 \csc ^2\left (\frac {1}{2} \left (c+\frac {\pi }{2}\right )+\frac {d x}{2}\right ) \, dx}{2 a}-\frac {(2 f) \int (e+f x) \log \left (1-e^{i (c+d x)}\right ) \, dx}{a d}+\frac {(2 f) \int (e+f x) \log \left (1+e^{i (c+d x)}\right ) \, dx}{a d}\\ &=-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d}+\frac {(e+f x)^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}+\frac {2 i f (e+f x) \text {Li}_2\left (-e^{i (c+d x)}\right )}{a d^2}-\frac {2 i f (e+f x) \text {Li}_2\left (e^{i (c+d x)}\right )}{a d^2}-\frac {(2 f) \int (e+f x) \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right ) \, dx}{a d}-\frac {\left (2 i f^2\right ) \int \text {Li}_2\left (-e^{i (c+d x)}\right ) \, dx}{a d^2}+\frac {\left (2 i f^2\right ) \int \text {Li}_2\left (e^{i (c+d x)}\right ) \, dx}{a d^2}\\ &=\frac {i (e+f x)^2}{a d}-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d}+\frac {(e+f x)^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}+\frac {2 i f (e+f x) \text {Li}_2\left (-e^{i (c+d x)}\right )}{a d^2}-\frac {2 i f (e+f x) \text {Li}_2\left (e^{i (c+d x)}\right )}{a d^2}-\frac {(4 f) \int \frac {e^{2 i \left (\frac {c}{2}+\frac {d x}{2}\right )} (e+f x)}{1-i e^{2 i \left (\frac {c}{2}+\frac {d x}{2}\right )}} \, dx}{a d}-\frac {\left (2 f^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2(-x)}{x} \, dx,x,e^{i (c+d x)}\right )}{a d^3}+\frac {\left (2 f^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2(x)}{x} \, dx,x,e^{i (c+d x)}\right )}{a d^3}\\ &=\frac {i (e+f x)^2}{a d}-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d}+\frac {(e+f x)^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {4 f (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d^2}+\frac {2 i f (e+f x) \text {Li}_2\left (-e^{i (c+d x)}\right )}{a d^2}-\frac {2 i f (e+f x) \text {Li}_2\left (e^{i (c+d x)}\right )}{a d^2}-\frac {2 f^2 \text {Li}_3\left (-e^{i (c+d x)}\right )}{a d^3}+\frac {2 f^2 \text {Li}_3\left (e^{i (c+d x)}\right )}{a d^3}+\frac {\left (4 f^2\right ) \int \log \left (1-i e^{2 i \left (\frac {c}{2}+\frac {d x}{2}\right )}\right ) \, dx}{a d^2}\\ &=\frac {i (e+f x)^2}{a d}-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d}+\frac {(e+f x)^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {4 f (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d^2}+\frac {2 i f (e+f x) \text {Li}_2\left (-e^{i (c+d x)}\right )}{a d^2}-\frac {2 i f (e+f x) \text {Li}_2\left (e^{i (c+d x)}\right )}{a d^2}-\frac {2 f^2 \text {Li}_3\left (-e^{i (c+d x)}\right )}{a d^3}+\frac {2 f^2 \text {Li}_3\left (e^{i (c+d x)}\right )}{a d^3}-\frac {\left (4 i f^2\right ) \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{2 i \left (\frac {c}{2}+\frac {d x}{2}\right )}\right )}{a d^3}\\ &=\frac {i (e+f x)^2}{a d}-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d}+\frac {(e+f x)^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {4 f (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d^2}+\frac {2 i f (e+f x) \text {Li}_2\left (-e^{i (c+d x)}\right )}{a d^2}+\frac {4 i f^2 \text {Li}_2\left (i e^{i (c+d x)}\right )}{a d^3}-\frac {2 i f (e+f x) \text {Li}_2\left (e^{i (c+d x)}\right )}{a d^2}-\frac {2 f^2 \text {Li}_3\left (-e^{i (c+d x)}\right )}{a d^3}+\frac {2 f^2 \text {Li}_3\left (e^{i (c+d x)}\right )}{a d^3}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 1.74, size = 363, normalized size = 1.46 \begin {gather*} \frac {-2 d^2 e^2 \tanh ^{-1}\left (e^{i (c+d x)}\right )+2 d^2 e f x \log \left (1-e^{i (c+d x)}\right )+d^2 f^2 x^2 \log \left (1-e^{i (c+d x)}\right )-2 d^2 e f x \log \left (1+e^{i (c+d x)}\right )-d^2 f^2 x^2 \log \left (1+e^{i (c+d x)}\right )+2 i d f (e+f x) \text {Li}_2\left (-e^{i (c+d x)}\right )-2 i d f (e+f x) \text {Li}_2\left (e^{i (c+d x)}\right )-2 f^2 \text {Li}_3\left (-e^{i (c+d x)}\right )+2 f^2 \text {Li}_3\left (e^{i (c+d x)}\right )+2 i f \left (2 i d (e+f x) \log (1-i \cos (c+d x)+\sin (c+d x))+2 f \text {Li}_2(i \cos (c+d x)-\sin (c+d x))+\frac {d^2 x (2 e+f x) (\cos (c)+i \sin (c))}{\cos (c)+i (1+\sin (c))}\right )-\frac {2 d^2 (e+f x)^2 \sin \left (\frac {d x}{2}\right )}{\left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}}{a d^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((e + f*x)^2*Csc[c + d*x])/(a + a*Sin[c + d*x]),x]

[Out]

(-2*d^2*e^2*ArcTanh[E^(I*(c + d*x))] + 2*d^2*e*f*x*Log[1 - E^(I*(c + d*x))] + d^2*f^2*x^2*Log[1 - E^(I*(c + d*
x))] - 2*d^2*e*f*x*Log[1 + E^(I*(c + d*x))] - d^2*f^2*x^2*Log[1 + E^(I*(c + d*x))] + (2*I)*d*f*(e + f*x)*PolyL
og[2, -E^(I*(c + d*x))] - (2*I)*d*f*(e + f*x)*PolyLog[2, E^(I*(c + d*x))] - 2*f^2*PolyLog[3, -E^(I*(c + d*x))]
 + 2*f^2*PolyLog[3, E^(I*(c + d*x))] + (2*I)*f*((2*I)*d*(e + f*x)*Log[1 - I*Cos[c + d*x] + Sin[c + d*x]] + 2*f
*PolyLog[2, I*Cos[c + d*x] - Sin[c + d*x]] + (d^2*x*(2*e + f*x)*(Cos[c] + I*Sin[c]))/(Cos[c] + I*(1 + Sin[c]))
) - (2*d^2*(e + f*x)^2*Sin[(d*x)/2])/((Cos[c/2] + Sin[c/2])*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])))/(a*d^3)

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 642 vs. \(2 (223 ) = 446\).
time = 0.15, size = 643, normalized size = 2.58

method result size
risch \(\frac {4 i f^{2} c x}{a \,d^{2}}+\frac {2 x^{2} f^{2}+4 e f x +2 e^{2}}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}-\frac {4 f^{2} \ln \left (1-i {\mathrm e}^{i \left (d x +c \right )}\right ) x}{a \,d^{2}}-\frac {4 f^{2} \ln \left (1-i {\mathrm e}^{i \left (d x +c \right )}\right ) c}{a \,d^{3}}+\frac {4 i f^{2} \polylog \left (2, i {\mathrm e}^{i \left (d x +c \right )}\right )}{a \,d^{3}}+\frac {4 f^{2} c \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{a \,d^{3}}-\frac {4 f^{2} c \ln \left ({\mathrm e}^{i \left (d x +c \right )}\right )}{a \,d^{3}}-\frac {4 f \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) e}{a \,d^{2}}+\frac {4 f \ln \left ({\mathrm e}^{i \left (d x +c \right )}\right ) e}{a \,d^{2}}+\frac {2 i f^{2} x^{2}}{a d}+\frac {2 i f^{2} c^{2}}{a \,d^{3}}-\frac {2 i e f \polylog \left (2, {\mathrm e}^{i \left (d x +c \right )}\right )}{d^{2} a}+\frac {2 i e f \polylog \left (2, -{\mathrm e}^{i \left (d x +c \right )}\right )}{d^{2} a}-\frac {2 i f^{2} \polylog \left (2, {\mathrm e}^{i \left (d x +c \right )}\right ) x}{d^{2} a}+\frac {2 i f^{2} \polylog \left (2, -{\mathrm e}^{i \left (d x +c \right )}\right ) x}{d^{2} a}+\frac {e^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d a}-\frac {e^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d a}-\frac {2 f^{2} \polylog \left (3, -{\mathrm e}^{i \left (d x +c \right )}\right )}{a \,d^{3}}+\frac {2 f^{2} \polylog \left (3, {\mathrm e}^{i \left (d x +c \right )}\right )}{a \,d^{3}}-\frac {f^{2} c^{2} \ln \left (1-{\mathrm e}^{i \left (d x +c \right )}\right )}{d^{3} a}+\frac {f^{2} \ln \left (1-{\mathrm e}^{i \left (d x +c \right )}\right ) x^{2}}{d a}-\frac {f^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) x^{2}}{d a}+\frac {f^{2} c^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d^{3} a}+\frac {2 \ln \left (1-{\mathrm e}^{i \left (d x +c \right )}\right ) e f x}{d a}-\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) e f x}{d a}+\frac {2 \ln \left (1-{\mathrm e}^{i \left (d x +c \right )}\right ) c e f}{d^{2} a}-\frac {2 e f c \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d^{2} a}\) \(643\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f*x+e)^2*csc(d*x+c)/(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

4*I/a/d^2*f^2*c*x+2*(f^2*x^2+2*e*f*x+e^2)/d/a/(exp(I*(d*x+c))+I)+4*I*f^2*polylog(2,I*exp(I*(d*x+c)))/a/d^3+1/d
/a*e^2*ln(exp(I*(d*x+c))-1)-1/d/a*e^2*ln(exp(I*(d*x+c))+1)+4/a/d^2*f*ln(exp(I*(d*x+c)))*e-4/a/d^2*f^2*ln(1-I*e
xp(I*(d*x+c)))*x-4/a/d^3*f^2*ln(1-I*exp(I*(d*x+c)))*c+4/a/d^3*f^2*c*ln(exp(I*(d*x+c))+I)-4/a/d^3*f^2*c*ln(exp(
I*(d*x+c)))+2*I/a/d*f^2*x^2+2*I/a/d^3*f^2*c^2-4/a/d^2*f*ln(exp(I*(d*x+c))+I)*e+2/d/a*ln(1-exp(I*(d*x+c)))*e*f*
x-2/d/a*ln(exp(I*(d*x+c))+1)*e*f*x+2/d^2/a*ln(1-exp(I*(d*x+c)))*c*e*f-2/d^2/a*e*f*c*ln(exp(I*(d*x+c))-1)-2*I/d
^2/a*e*f*polylog(2,exp(I*(d*x+c)))+2*I/d^2/a*e*f*polylog(2,-exp(I*(d*x+c)))-2*I/d^2/a*f^2*polylog(2,exp(I*(d*x
+c)))*x+2*I/d^2/a*f^2*polylog(2,-exp(I*(d*x+c)))*x-1/d^3/a*f^2*c^2*ln(1-exp(I*(d*x+c)))+1/d/a*f^2*ln(1-exp(I*(
d*x+c)))*x^2-1/d/a*f^2*ln(exp(I*(d*x+c))+1)*x^2+1/d^3/a*f^2*c^2*ln(exp(I*(d*x+c))-1)-2*f^2*polylog(3,-exp(I*(d
*x+c)))/a/d^3+2*f^2*polylog(3,exp(I*(d*x+c)))/a/d^3

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1443 vs. \(2 (220) = 440\).
time = 0.49, size = 1443, normalized size = 5.80 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^2*csc(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

-(2*c*f*(2/(a*d + a*d*sin(d*x + c)/(cos(d*x + c) + 1)) + log(sin(d*x + c)/(cos(d*x + c) + 1))/(a*d))*e - (log(
sin(d*x + c)/(cos(d*x + c) + 1))/a + 2/(a + a*sin(d*x + c)/(cos(d*x + c) + 1)))*e^2 + (4*I*c^2*f^2 - 8*(I*c*f^
2 - I*d*f*e + (c*f^2 - d*f*e)*cos(d*x + c) + (I*c*f^2 - I*d*f*e)*sin(d*x + c))*arctan2(sin(d*x + c) + 1, cos(d
*x + c)) - 8*((d*x + c)*f^2*cos(d*x + c) + I*(d*x + c)*f^2*sin(d*x + c) + I*(d*x + c)*f^2)*arctan2(cos(d*x + c
), sin(d*x + c) + 1) - 2*(-I*(d*x + c)^2*f^2 - I*c^2*f^2 + 2*(I*c*f^2 - I*d*f*e)*(d*x + c) - ((d*x + c)^2*f^2
+ c^2*f^2 - 2*(c*f^2 - d*f*e)*(d*x + c))*cos(d*x + c) + (-I*(d*x + c)^2*f^2 - I*c^2*f^2 + 2*(I*c*f^2 - I*d*f*e
)*(d*x + c))*sin(d*x + c))*arctan2(sin(d*x + c), cos(d*x + c) + 1) - 2*(c^2*f^2*cos(d*x + c) + I*c^2*f^2*sin(d
*x + c) + I*c^2*f^2)*arctan2(sin(d*x + c), cos(d*x + c) - 1) - 2*(-I*(d*x + c)^2*f^2 + 2*(I*c*f^2 - I*d*f*e)*(
d*x + c) - ((d*x + c)^2*f^2 - 2*(c*f^2 - d*f*e)*(d*x + c))*cos(d*x + c) + (-I*(d*x + c)^2*f^2 + 2*(I*c*f^2 - I
*d*f*e)*(d*x + c))*sin(d*x + c))*arctan2(sin(d*x + c), -cos(d*x + c) + 1) - 4*((d*x + c)^2*f^2 - 2*(c*f^2 - d*
f*e)*(d*x + c))*cos(d*x + c) - 8*(f^2*cos(d*x + c) + I*f^2*sin(d*x + c) + I*f^2)*dilog(I*e^(I*d*x + I*c)) - 4*
(I*(d*x + c)*f^2 - I*c*f^2 + I*d*f*e + ((d*x + c)*f^2 - c*f^2 + d*f*e)*cos(d*x + c) + (I*(d*x + c)*f^2 - I*c*f
^2 + I*d*f*e)*sin(d*x + c))*dilog(-e^(I*d*x + I*c)) - 4*(-I*(d*x + c)*f^2 + I*c*f^2 - I*d*f*e - ((d*x + c)*f^2
 - c*f^2 + d*f*e)*cos(d*x + c) + (-I*(d*x + c)*f^2 + I*c*f^2 - I*d*f*e)*sin(d*x + c))*dilog(e^(I*d*x + I*c)) +
 ((d*x + c)^2*f^2 + c^2*f^2 - 2*(c*f^2 - d*f*e)*(d*x + c) + (-I*(d*x + c)^2*f^2 - I*c^2*f^2 - 2*(-I*c*f^2 + I*
d*f*e)*(d*x + c))*cos(d*x + c) + ((d*x + c)^2*f^2 + c^2*f^2 - 2*(c*f^2 - d*f*e)*(d*x + c))*sin(d*x + c))*log(c
os(d*x + c)^2 + sin(d*x + c)^2 + 2*cos(d*x + c) + 1) - ((d*x + c)^2*f^2 + c^2*f^2 - 2*(c*f^2 - d*f*e)*(d*x + c
) - (I*(d*x + c)^2*f^2 + I*c^2*f^2 - 2*(I*c*f^2 - I*d*f*e)*(d*x + c))*cos(d*x + c) + ((d*x + c)^2*f^2 + c^2*f^
2 - 2*(c*f^2 - d*f*e)*(d*x + c))*sin(d*x + c))*log(cos(d*x + c)^2 + sin(d*x + c)^2 - 2*cos(d*x + c) + 1) + 4*(
(d*x + c)*f^2 - c*f^2 + d*f*e - (I*(d*x + c)*f^2 - I*c*f^2 + I*d*f*e)*cos(d*x + c) + ((d*x + c)*f^2 - c*f^2 +
d*f*e)*sin(d*x + c))*log(cos(d*x + c)^2 + sin(d*x + c)^2 + 2*sin(d*x + c) + 1) - 4*(I*f^2*cos(d*x + c) - f^2*s
in(d*x + c) - f^2)*polylog(3, -e^(I*d*x + I*c)) - 4*(-I*f^2*cos(d*x + c) + f^2*sin(d*x + c) + f^2)*polylog(3,
e^(I*d*x + I*c)) - 4*(I*(d*x + c)^2*f^2 + 2*(-I*c*f^2 + I*d*f*e)*(d*x + c))*sin(d*x + c))/(-2*I*a*d^2*cos(d*x
+ c) + 2*a*d^2*sin(d*x + c) + 2*a*d^2))/d

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1666 vs. \(2 (220) = 440\).
time = 0.44, size = 1666, normalized size = 6.69 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^2*csc(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(2*d^2*f^2*x^2 + 4*d^2*f*x*e + 2*d^2*e^2 + 2*(d^2*f^2*x^2 + 2*d^2*f*x*e + d^2*e^2)*cos(d*x + c) - 2*(I*d*f
^2*x + I*d*f*e + (I*d*f^2*x + I*d*f*e)*cos(d*x + c) + (I*d*f^2*x + I*d*f*e)*sin(d*x + c))*dilog(cos(d*x + c) +
 I*sin(d*x + c)) - 2*(-I*d*f^2*x - I*d*f*e + (-I*d*f^2*x - I*d*f*e)*cos(d*x + c) + (-I*d*f^2*x - I*d*f*e)*sin(
d*x + c))*dilog(cos(d*x + c) - I*sin(d*x + c)) - 4*(-I*f^2*cos(d*x + c) - I*f^2*sin(d*x + c) - I*f^2)*dilog(I*
cos(d*x + c) - sin(d*x + c)) - 4*(I*f^2*cos(d*x + c) + I*f^2*sin(d*x + c) + I*f^2)*dilog(-I*cos(d*x + c) - sin
(d*x + c)) - 2*(I*d*f^2*x + I*d*f*e + (I*d*f^2*x + I*d*f*e)*cos(d*x + c) + (I*d*f^2*x + I*d*f*e)*sin(d*x + c))
*dilog(-cos(d*x + c) + I*sin(d*x + c)) - 2*(-I*d*f^2*x - I*d*f*e + (-I*d*f^2*x - I*d*f*e)*cos(d*x + c) + (-I*d
*f^2*x - I*d*f*e)*sin(d*x + c))*dilog(-cos(d*x + c) - I*sin(d*x + c)) - (d^2*f^2*x^2 + 2*d^2*f*x*e + d^2*e^2 +
 (d^2*f^2*x^2 + 2*d^2*f*x*e + d^2*e^2)*cos(d*x + c) + (d^2*f^2*x^2 + 2*d^2*f*x*e + d^2*e^2)*sin(d*x + c))*log(
cos(d*x + c) + I*sin(d*x + c) + 1) + 4*(c*f^2 - d*f*e + (c*f^2 - d*f*e)*cos(d*x + c) + (c*f^2 - d*f*e)*sin(d*x
 + c))*log(cos(d*x + c) + I*sin(d*x + c) + I) - (d^2*f^2*x^2 + 2*d^2*f*x*e + d^2*e^2 + (d^2*f^2*x^2 + 2*d^2*f*
x*e + d^2*e^2)*cos(d*x + c) + (d^2*f^2*x^2 + 2*d^2*f*x*e + d^2*e^2)*sin(d*x + c))*log(cos(d*x + c) - I*sin(d*x
 + c) + 1) - 4*(d*f^2*x + c*f^2 + (d*f^2*x + c*f^2)*cos(d*x + c) + (d*f^2*x + c*f^2)*sin(d*x + c))*log(I*cos(d
*x + c) + sin(d*x + c) + 1) - 4*(d*f^2*x + c*f^2 + (d*f^2*x + c*f^2)*cos(d*x + c) + (d*f^2*x + c*f^2)*sin(d*x
+ c))*log(-I*cos(d*x + c) + sin(d*x + c) + 1) + (c^2*f^2 - 2*c*d*f*e + d^2*e^2 + (c^2*f^2 - 2*c*d*f*e + d^2*e^
2)*cos(d*x + c) + (c^2*f^2 - 2*c*d*f*e + d^2*e^2)*sin(d*x + c))*log(-1/2*cos(d*x + c) + 1/2*I*sin(d*x + c) + 1
/2) + (c^2*f^2 - 2*c*d*f*e + d^2*e^2 + (c^2*f^2 - 2*c*d*f*e + d^2*e^2)*cos(d*x + c) + (c^2*f^2 - 2*c*d*f*e + d
^2*e^2)*sin(d*x + c))*log(-1/2*cos(d*x + c) - 1/2*I*sin(d*x + c) + 1/2) + (d^2*f^2*x^2 - c^2*f^2 + (d^2*f^2*x^
2 - c^2*f^2 + 2*(d^2*f*x + c*d*f)*e)*cos(d*x + c) + 2*(d^2*f*x + c*d*f)*e + (d^2*f^2*x^2 - c^2*f^2 + 2*(d^2*f*
x + c*d*f)*e)*sin(d*x + c))*log(-cos(d*x + c) + I*sin(d*x + c) + 1) + 4*(c*f^2 - d*f*e + (c*f^2 - d*f*e)*cos(d
*x + c) + (c*f^2 - d*f*e)*sin(d*x + c))*log(-cos(d*x + c) + I*sin(d*x + c) + I) + (d^2*f^2*x^2 - c^2*f^2 + (d^
2*f^2*x^2 - c^2*f^2 + 2*(d^2*f*x + c*d*f)*e)*cos(d*x + c) + 2*(d^2*f*x + c*d*f)*e + (d^2*f^2*x^2 - c^2*f^2 + 2
*(d^2*f*x + c*d*f)*e)*sin(d*x + c))*log(-cos(d*x + c) - I*sin(d*x + c) + 1) + 2*(f^2*cos(d*x + c) + f^2*sin(d*
x + c) + f^2)*polylog(3, cos(d*x + c) + I*sin(d*x + c)) + 2*(f^2*cos(d*x + c) + f^2*sin(d*x + c) + f^2)*polylo
g(3, cos(d*x + c) - I*sin(d*x + c)) - 2*(f^2*cos(d*x + c) + f^2*sin(d*x + c) + f^2)*polylog(3, -cos(d*x + c) +
 I*sin(d*x + c)) - 2*(f^2*cos(d*x + c) + f^2*sin(d*x + c) + f^2)*polylog(3, -cos(d*x + c) - I*sin(d*x + c)) -
2*(d^2*f^2*x^2 + 2*d^2*f*x*e + d^2*e^2)*sin(d*x + c))/(a*d^3*cos(d*x + c) + a*d^3*sin(d*x + c) + a*d^3)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {e^{2} \csc {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx + \int \frac {f^{2} x^{2} \csc {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx + \int \frac {2 e f x \csc {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)**2*csc(d*x+c)/(a+a*sin(d*x+c)),x)

[Out]

(Integral(e**2*csc(c + d*x)/(sin(c + d*x) + 1), x) + Integral(f**2*x**2*csc(c + d*x)/(sin(c + d*x) + 1), x) +
Integral(2*e*f*x*csc(c + d*x)/(sin(c + d*x) + 1), x))/a

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^2*csc(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

integrate((f*x + e)^2*csc(d*x + c)/(a*sin(d*x + c) + a), x)

________________________________________________________________________________________

Mupad [F(-1)]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \text {Hanged} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e + f*x)^2/(sin(c + d*x)*(a + a*sin(c + d*x))),x)

[Out]

\text{Hanged}

________________________________________________________________________________________